class ApplicationAccountsBundleVariations < ActiveRecord::Migration
  def self.up
    # drop_table :application_accounts_bundles
     
    create_table :application_accounts_bundle_variations, {:id => false} do |t|
      t.references :application_account
      t.references :bundle_variation
    end
    add_index :application_accounts_bundle_variations, :bundle_variation_id, :name => :app_bundle_variation_id
    # add_index :application_accounts_bundle_variables, :bundle_id -- check later to add one more column to the table
    add_index :application_accounts_bundle_variations, :application_account_id, :name =>:app_application_id

  end

  def self.down
    drop_table :application_accounts_bundle_variations
    
    create_table :application_accounts_bundles, {:id => false} do |t|
      t.references :application_account
      t.references :bundle
    end
    add_index :application_accounts_bundles, :bundle_id
    add_index :application_accounts_bundles, :application_account_id
    
  end
end
